#include <iostream>
#include <leveldb/db.h>
#include <string>

#define DB_PATH "/tmp/leveldb"

int main(int argc, char** argv)
{
	std::cout << DB_PATH  << std::endl;
	leveldb::Options opts;
	opts.create_if_missing = true;

	leveldb::DB *db = nullptr;

	leveldb::Status status = leveldb::DB::Open(opts, DB_PATH, &db);
	if (status.ok()) {
		std::cout << "leveldb open success" << std::endl;
	} else {
		std::cout << "failed to open db" << status.ToString() << std::endl;
	}

	if (db){
		delete db;
	}

	return 0;
}
